package com.zs.admin.vo.wisdbook;

import com.alibaba.fastjson2.JSONObject;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.zs.common.util.StringUtils;
import com.zs.common.util.YmlUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
@ApiModel("智书标记块数据列表Vo")
public class WisdbookPageMarkQuestListedVo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "标注块id")
    private String id;

    @ApiModelProperty(value = "页id")
    private Integer pageId;

    @ApiModelProperty(value = "父id")
    private String pid;

    @ApiModelProperty(value = "父页id")
    private Integer ppageId;

    @ApiModelProperty(value = "块图地址")
    private String imgUrl;

    @ApiModelProperty(value = "位置信息json")
    private String shape;

    @ApiModelProperty(value = "矩形框")
    private String featureType;

    @ApiModelProperty(value = "标注类型")
    private String markType;

    @ApiModelProperty(value = "子框")
    private List<WisdbookPageMarkQuestListedVo> childs;

    @JsonIgnore
    @ApiModelProperty(value = "")
    private String createTime;

    @JsonIgnore
    @ApiModelProperty(value = "")
    private String updateTime;

    @ApiModelProperty(value = "")
    private Long questId;


    @ApiModelProperty(value = "")
    private Long markQuestId;

    @ApiModelProperty(value = "question")
    private String question;

    public String getImgUrl() {
        String https = YmlUtils.get("ossResource.https");
        if(StringUtils.isNotEmpty(imgUrl)){
            return https+imgUrl;
        }
        return YmlUtils.get("sysconf.app-host")+"api/wisdbook/page/markImg/render.png?markId="+id;
    }
}
